<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <style>
    body {
      width: 320px;
      padding: 12px;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
      background: #f8f9fa;
      margin: 0;
    }

    h3 {
      margin: 0 0 12px 0;
      color: #1a73e8;
      font-size: 16px;
      text-align: center;
      padding-bottom: 8px;
      border-bottom: 2px solid #e8eaed;
    }

    .status {
      margin: 6px 0;
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 12px;
      transition: all 0.3s ease;
    }

    .success {
      background-color: #e6f4ea;
      color: #1e8e3e;
      border: 1px solid #d4ebda;
    }

    .error {
      background-color: #fce8e6;
      color: #d93025;
      border: 1px solid #fad2cf;
    }

    .list-container {
      margin-top: 8px;
      border: 1px solid #dadce0;
      border-radius: 8px;
      background: white;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .list-title {
      padding: 8px 10px;
      background-color: #f8f9fa;
      border-bottom: 1px solid #dadce0;
      font-weight: 500;
      color: #3c4043;
      border-radius: 8px 8px 0 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .signed-list, .topic-list {
      max-height: 150px;
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: #dadce0 transparent;
    }

    .signed-list::-webkit-scrollbar, .topic-list::-webkit-scrollbar {
      width: 6px;
    }

    .signed-list::-webkit-scrollbar-thumb, .topic-list::-webkit-scrollbar-thumb {
      background-color: #dadce0;
      border-radius: 3px;
    }

    .list-item {
      padding: 6px 10px;
      border-bottom: 1px solid #f1f3f4;
      font-size: 13px;
      transition: background-color 0.2s;
    }

    .list-item:last-child {
      border-bottom: none;
    }

    .list-item:hover {
      background-color: #f8f9fa;
    }

    .button {
      padding: 8px 16px;
      background-color: white;
      border: 1px solid #dadce0;
      border-radius: 6px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 500;
      color: #3c4043;
      transition: all 0.2s ease;
      outline: none;
    }

    .button:hover {
      background-color: #f8f9fa;
      border-color: #d2e3fc;
    }

    .button:active {
      background-color: #f1f3f4;
    }

    .start-btn {
      background-color: #1a73e8;
      border-color: #1a73e8;
      color: white;
    }

    .start-btn:hover {
      background-color: #1557b0;
      border-color: #1557b0;
    }

    .input-group {
      margin: 8px 0;
      display: flex;
      gap: 8px;
    }

    .input-group input {
      flex: 1;
      padding: 6px 10px;
      border: 1px solid #dadce0;
      border-radius: 6px;
      font-size: 13px;
      outline: none;
      transition: border-color 0.2s;
    }

    .input-group input:focus {
      border-color: #1a73e8;
    }

    .topic-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }

    .topic-id {
      color: #5f6368;
      font-size: 11px;
      flex-shrink: 1;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .delete-btn {
      color: #d93025;
      cursor: pointer;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 14px;
      transition: background-color 0.2s;
    }

    .delete-btn:hover {
      background-color: #fce8e6;
    }

    .watermark {
      margin-top: 10px;
      text-align: center;
      color: #80868b;
      font-size: 12px;
      font-style: italic;
    }

    .date-nav {
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 13px;
    }

    .nav-btn {
      padding: 4px 8px;
      background: none;
      border: none;
      cursor: pointer;
      color: #1a73e8;
      font-size: 16px;
      border-radius: 4px;
      transition: background-color 0.2s;
    }

    .nav-btn:hover:not(:disabled) {
      background-color: #f1f3f4;
    }

    .nav-btn:disabled {
      color: #dadce0;
      cursor: not-allowed;
    }

    #currentDate {
      min-width: 80px;
      text-align: center;
      color: #3c4043;
      font-weight: 500;
    }

    .action-buttons {
      display: flex;
      gap: 8px;
      margin: 8px 0;
    }

    .action-buttons .button {
      flex: 1;
      margin: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    /* 添加图标样式 */
    .icon {
      font-size: 16px;
    }

    /* 添加动画效果 */
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .list-container {
      animation: fadeIn 0.3s ease-out;
    }

    .topic-count {
      font-size: 12px;
      color: #5f6368;
      font-weight: normal;
      background: #f1f3f4;
      padding: 2px 8px;
      border-radius: 12px;
    }

    .title-group {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .clear-btn {
      padding: 2px 8px;
      background: none;
      border: none;
      font-size: 12px;
      color: #d93025;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      border-radius: 4px;
      transition: all 0.2s ease;
    }

    .clear-btn:hover {
      background-color: #fce8e6;
    }

    .clear-btn .icon {
      font-size: 14px;
    }

    /* 修改列表标题样式以适应新布局 */
    .list-title {
      padding: 8px 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .time-setting {
      margin: 8px 0;
      padding: 6px 10px;
      background: white;
      border: 1px solid #dadce0;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .time-label {
      color: #3c4043;
      font-size: 13px;
    }

    .time-input {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .time-picker {
      padding: 4px 8px;
      border: 1px solid #dadce0;
      border-radius: 4px;
      font-size: 13px;
      color: #3c4043;
      outline: none;
    }

    .time-picker:focus {
      border-color: #1a73e8;
    }

    /* 开关样式 */
    .switch {
      position: relative;
      display: inline-block;
      width: 40px;
      height: 20px;
      vertical-align: middle;
      margin-left: 8px;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      transition: .3s;
      border-radius: 20px;
    }

    .slider:before {
      position: absolute;
      content: "";
      height: 16px;
      width: 16px;
      left: 2px;
      bottom: 2px;
      background-color: white;
      transition: .3s;
      border-radius: 50%;
    }

    input:checked + .slider {
      background-color: #1a73e8;
    }

    input:checked + .slider:before {
      transform: translateX(20px);
    }

    .time-setting {
      margin: 8px 0;
      padding: 6px 10px;
      background: white;
      border: 1px solid #dadce0;
      border-radius: 6px;
    }

    .time-label {
      color: #3c4043;
      font-size: 13px;
      display: flex;
      align-items: center;
      margin-bottom: 8px;
    }

    .time-input {
      display: flex;
      gap: 8px;
      align-items: center;
      margin-top: 8px;
    }

    .stop-btn {
      background-color: #d93025;
      border-color: #d93025;
      color: white;
    }

    .stop-btn:hover {
      background-color: #a50e0e;
      border-color: #a50e0e;
    }

    #stopCheckIn {
      margin-top: 6px !important;
    }
  </style>
</head>
<body>
  <h3>微博超话签到助手</h3>
  
  <div>
    <button id="startCheckIn" class="button start-btn" style="width: 100%;">
      <span class="icon">✓</span> 开始签到
    </button>
    <button id="stopCheckIn" class="button stop-btn" style="width: 100%; display: none; margin-top: 6px;">
      <span class="icon">×</span> 停止签到
    </button>
    <div id="statusMessage" class="status"></div>
  </div>
  
  <div class="time-setting">
    <div style="display: flex; justify-content: space-between; align-items: center;">
      <div class="time-label" style="display: flex; align-items: center; margin: 0;">
        <span>每日自动签到：</span>
        <label class="switch">
          <input type="checkbox" id="autoCheckSwitch">
          <span class="slider"></span>
        </label>
      </div>
      <div class="time-input" id="timeInputGroup" style="display: flex; margin: 0;">
        <input type="time" id="autoCheckTime" class="time-picker">
        <button id="saveTime" class="button">保存</button>
      </div>
    </div>
  </div>
  
  <div class="input-group">
    <input type="text" id="topicInput" placeholder="输入超话ID (网址中10080开头的部分)">
    <button id="addTopic" class="button">添加</button>
  </div>
  
  <div class="input-group">
    <button id="addCurrentTopic" class="button" style="width: 100%;">
      <span class="icon">+</span> 添加当前页面超话
    </button>
  </div>
  
  <div class="list-container">
    <div class="list-title">
      <span>已添加的超话</span>
      <span class="topic-count" id="topicCount">0个</span>
    </div>
    <div class="topic-list" id="topicList">
      <div class="list-item">暂未添加超话</div>
    </div>
    <div class="action-buttons" style="border-top: 1px solid #dadce0; margin: 0; padding: 10px;">
      <button id="exportTopics" class="button">
        <span class="icon">↓</span> 导出超话
      </button>
      <input type="file" id="importFile" accept=".csv" style="display: none;">
      <button id="importTopics" class="button">
        <span class="icon">↑</span> 导入超话
      </button>
    </div>
  </div>
  
  <div class="watermark">
    Created by MapleX
  </div>
  
  <script src="popup.js"></script>
</body>
</html> 